import { request } from '@/utils/request.js'

// 获取登录验证码
export function getLoginCode(phone) {
	return request('GET',`/captcha/sent?phone=${phone}`)
}

// 使用密码登录
export function passwordLogin(phone,password) {
	const params = { phone,password }
	return request('GET','/login/cellphone', params)
}

// 使用验证码登录
export function phoneLogin(phone,captcha) {
	const params = { phone,captcha }
	return request('GET','/captcha/verify', params)
}

// 获取个人信息
export function getUserInfo() {
	return request('GET','/user/account')
}

// 获取用户等级信息
export function getUserLevel() {
	return request('GET','/user/level')
}